package com.yjd.pub.app.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.comm.app.model.MerchantPushRegidModel;
import com.yjd.comm.app.service.IMerchantPushRegidService;
import com.yjd.pub.app.dao.IMerchantPushRegidDao;

/**
 * <b>description</b>：商户推送服务表业务实现<br>
 * <b>time</b>：2017-11-27 10:34:25 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
@Service("merchantPushRegidService")
public class MerchantPushRegidServiceImpl extends BaseServiceImpl implements IMerchantPushRegidService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public MerchantPushRegidModel insert(MerchantPushRegidModel model) throws Exception {
		return this.merchantPushRegidDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(MerchantPushRegidModel model) throws Exception {
		return this.merchantPushRegidDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("id", id);
		return this.merchantPushRegidDao.deleteModel(paramMap, true);
	}

	@Override
	public List<String> queryRegids(Map<String, Object> param) throws Exception {
		return this.merchantPushRegidDao.queryRegids(param);
	}

	@Resource
	private IMerchantPushRegidDao merchantPushRegidDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.merchantPushRegidDao;
	}

}
